<?php
/**
 * @特惠赚、配置控制器
 * Author: 小谢     
 * Date: 2019/05/11
 */
namespace app\admin\controller;
use think\facade\Session;
use think\facade\View;
use think\Db;

class Configs extends Base {
    
    /**
     * @brief 基本配置
     */
    public function setting() {
        $data = I('post.');
        if(isset($data['id']) && $data['id'] > 0) {
            $res = M('basic_config')->where(['id'=>$data['id']])->update($data);
            if($res) {
                $this->success("操作成功",'/Admin/configs/setting');
            }
            $this->success("操作失败",'/Admin/configs/setting');
        }
        $info = M('basic_config')->find();
        View::share(['info'=>$info]);
        return View();
    }
    
}